<template>
	<view :class="['growing-info']">
		<view class="growing-info-box">
			<image :src="data" v-for="(data,index) in imgList" :key="index" mode="widthFix" style="width: 100%;"></image>
		</view>
		<view class="growing-info-btn"><button type="primary" @click="goUrl">去完成</button></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imgList: [],
				type: ''
			};
		},
		onLoad(options) {
			this.init(options.type)
			if(options.type){
				this.type = options.type
				switch (Number(options.type)){
					case 1:
						uni.setNavigationBarTitle({
							title: '店铺设置'
						})
						break;
					case 2:
						uni.setNavigationBarTitle({
							title: '设置轮播图'
						})
						break;
					case 3:
						uni.setNavigationBarTitle({
							title: '上传商品'
						})
						break;
					case 4:
						uni.setNavigationBarTitle({
							title: '上传案例'
						})
						break;
					case 5:
						uni.setNavigationBarTitle({
							title: '上传设计师'
						})
						break;
					case 6:
						uni.setNavigationBarTitle({
							title: '选择平台商品'
						})
						break;
					case 7:
						uni.setNavigationBarTitle({
							title: '上传自定义海报'
						})
						break;
					case 8:
						uni.setNavigationBarTitle({
							title: '上传视频'
						})
						break;
					case 9:
						uni.setNavigationBarTitle({
							title: '员工管理'
						})
						break;
					case 10:
						uni.setNavigationBarTitle({
							title: '分享店铺'
						})
						break;
					case 11:
						uni.setNavigationBarTitle({
							title: '确认订单'
						})
						break;
					case 12:
						uni.setNavigationBarTitle({
							title: '订单发货'
						})
						break;
					case 13:
						uni.setNavigationBarTitle({
							title: '完成提现'
						})
						break;
				}
			}
		},
		methods: {
			init(sort){
				this.$api.GrowLists({store_id: JSON.parse(uni.getStorageSync('userInfo')).store_id,limit: 20}).then(res => {
					if(res.datas.length){
						res.datas.forEach(item => {
							if(item.sort==sort){
								this.imgList = item.image_list
							}
						})
					}
				})
			},
			goUrl(){
				switch (Number(this.type)){
					case 1:
						uni.navigateTo({
							url: '/pages/my/store-settings'
						})
						break;
					case 2:
						uni.navigateTo({
							url: '/pages/carousel-manage/carousel-manage'
						})
						break;
					case 3:
						uni.navigateTo({
							url: '/pages/product-manage/product-manage'
						})
						break;
					case 4:
						uni.navigateTo({
							url: '/pages/case-manage/case-manage'
						})
						break;
					case 5:
						uni.navigateTo({
							url: '/pages/desiger-manage/desiger-manage'
						})
						break;
					case 6:
						uni.navigateTo({
							url: '/pages/platform-goods/platform-category'
						})
						break;
					case 7:
						uni.navigateTo({
							url: '/pages/custom-poster/custom-poster'
						})
						break;
					case 8:
						uni.navigateTo({
							url: '/pages/video-manage/video-manage'
						})
						break;
					case 9:
						uni.navigateTo({
							url: '/pages/staff/staff'
						})
						break;
					case 10:
						uni.navigateTo({
							url: '/pages/my/share'
						})
						break;
					case 11:
						uni.switchTab({
							url: '/pages/order/order'
						})
						break;
					case 12:
						uni.switchTab({
							url: '/pages/order/order'
						})
						break;
					case 13:
						uni.navigateTo({
							url: '/pages/my/wallet/wallet'
						})
						break;
					case 14:
						uni.navigateTo({
							url: '/pages/coupon/coupon'
						})
						break;
				}
			}
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #FFF;
	}
	.growing-info{
		padding-bottom: 140rpx;
		&.pd0{
			padding-bottom: 0;
		}
		.growing-info-box{
			padding-top: 20rpx;
		}
		.growing-info-btn{
			position: fixed;
			bottom: 0;
			left: 0;
			right: 0;
			height: 140rpx;
			background-color: #FFF;
			border-top: solid 1px #EEE;
			button{
				margin: 0 75rpx;
				height: 100rpx;
				line-height: 100rpx;
				background-color: #2073F5;
				border-radius: 100rpx;
				font-size: 36rpx;
				margin-top: 20rpx;
			}
		}
	}
</style>